<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('member_update');?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>修改会员</title>
<link href="templates/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="templates/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/jquery.nicescroll.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/laymain.js"></script>

<script type="text/javascript" src="editor/kindeditor-min.js"></script>
<script type="text/javascript" src="editor/lang/zh_CN.js"></script>
<script type="text/javascript" src="templates/js/getuploadify.js"></script>
<script type="text/javascript">
   $(function () {
        //初始化表单验证
        $("#form").initValidform();
    });

</script>
</head>
<body class="mainbody">
<form name="form" id="form" method="post" action="member_save.php" >
<!--导航栏-->
<div class="location">
  <a href="javascript:history.back(-1);" class="back"><i></i><span>返回列表页</span></a>
  <a href="home.php" class="home"><i></i><span>首页</span></a>
  <i class="arrow"></i>
  <a href="member.php"><span>会员列表</span></a><i class="arrow"></i><span>修改会员</span>
  <a href="javascript:location.reload();" class="reload">刷新</a> 
</div>
<div class="line10"></div>
<!--/导航栏-->

<!--内容-->
<div id="floatHead" class="content-tab-wrap">
  <div class="content-tab">
    <div class="content-tab-ul-wrap">
      <ul>
        <li><a class="selected" href="javascript:;">基本信息</a></li>
        <li><a  href="javascript:;">拓展信息</a></li>
        <li><a  href="javascript:;">账户信息</a></li>
      </ul>
    </div>
  </div>
</div>
<?php
$row = $dosql->GetOne("SELECT * FROM `#@__member` WHERE `id`=$id");
?>
<div class="tab-content" style="overflow: visible" >
	<dl>
	<dt>用户名</dt>
	<dd><?php echo $row['username']; ?></dd> 
	</dl>
	<dl>
	<dt>用户名</dt>
	<dd><img src="../data/avatar/index.php?uid=<?php echo $row['id']; ?>&size=middle&rnd=<?php echo GetRandStr(); ?>" /><span class="Validform_checktip"><input name="delavatar" type="checkbox" value="1" />  删除头像 (会员头像在前台编辑)</span></dd> 
	</dl>
	<dl>
    <dt>会员组</dt>
    <dd>
      <div class="rule-single-select" >
       	<select name="groupid" id="groupid" >
			<?php
			$dosql->Execute("SELECT * FROM `#@__usergroup` ORDER BY id ASC");
			while($row2 = $dosql->GetArray())
			{	if($row2['id']==$row['groupid']) $select='selected="selected"';else $select=''; 
				echo '<option '.$select.' value="'.$row2['id'].'">'.$row2['groupname'].'</option>';
			}
			?>
		</select>

      </div>
	  		<span class="Validform_checktip">非认证会员用户组与经验值绑定，如只修改会员组请设置该会员为vip</span>
    </dd>
  </dl>

   <dl>
    <dt>会员模型</dt>
    <dd>
	   <div class="rule-single-select">
		<select name="modelid"  id="modelid"  datatype="*" errormsg="请选择会员模型！" sucmsg=" ">
			<option selected="selected" value=" ">会员模型</option>
			<?php
			$dosql->Execute("SELECT * FROM `#@__usermodel` ORDER BY id ASC");
			while($row3 = $dosql->GetArray())
			{	
			if($row3['id']==$row['modelid']) $select='selected="selected"';else $select=''; 
				echo '<option '.$select.' value="'.$row3['id'].'">'.$row3['modeltitle'].'</option>';
			}
			?></select> </div>
    </dd>
  </dl>
		<dl>
			<dt>密　码</dt>
			<dd>
			<input name="password" type="password" id="password" class="input" datatype="/^\s*$/|*"/>  <span class="Validform_checktip">若不修改密码请留空</span>
			</dd>
		</dl>		
		  <dl>
			<dt>确认密码</dt>
			<dd>
			<input name="repassword" type="password" id="repassword" datatype="/^\s*$/|*" recheck="password"  nullmsg="" errormsg="两次输入的密码不一致" sucmsg=" "  class="input" />
			</dd>
		  </dl> 
		 <dl>
			<dt>名称</dt>
			<dd><input name="nickname" type="text" value="<?php echo $row['nickname']; ?>" id="nickname" class="input normal" /></dd>
		  </dl>
		  <dl>
			<dt>邮箱</dt>
			<dd>
			<input type="text" name="email" id="email" value="<?php echo $row['email']; ?>" class="input normal" datatype="e" nullmsg="请填写邮箱" errormsg="" sucmsg=" " />
			  <span class="Validform_checktip"></span>
			</dd>
		  </dl> 
	<dl>
	
    <dt>手　机</dt>
    <dd>
     <input type="text" name="mobile" id="mobile"  value="<?php echo $row['mobile']; ?>" class="input" /> <span class="Validform_checktip"></span>
    </dd>
  </dl>

    <dl>
   <dt>认证</dt>
    <dd>
       <div class="rule-single-checkbox">
          <input id="enteruser" type="checkbox" name="enteruser" value="1"  <?php if($row['enteruser'] == '1') echo 'checked="checked"'; ?> />
     
      </div> <span class="Validform_checktip">*认证vip</span>
    </dd>
  </dl>
	
     <dl>
     <dt>会员状态</dt>
        <dd>
      <div class="rule-multi-radio">
        <span id="checkinfo"><input id="checkinfo_1" type="radio" name="checkinfo" value="true" <?php if($row['checkinfo'] == 'true') echo 'checked="checked"'; ?> /><label for="checkinfo_1">正常</label>
		<input id="checkinfo_2" type="radio" name="checkinfo" value="false" <?php if($row['checkinfo'] == 'false') echo 'checked="checked"'; ?> /><label for="checkinfo_2">锁定</label>
		</span>
      </div><span class="Validform_checktip">*锁定后会员无法登陆</span>
    </dd>
  </dl>
</div>

<!-----拓展信息---->
<div class="tab-content"  style="display: none;">
  <?php $mid  = isset($mid) ? $mid : $row['modelid']; 
	$m = $dosql->GetOne("SELECT modeltbname FROM `#@__usermodel` WHERE `id`='$mid'");
	$mtbname = $m['modeltbname'];
	$uid =$row['id'];
  $r = $dosql->GetOne("SELECT * FROM `$mtbname` WHERE `id`='$uid'");
  echo GetUserField($mid,$uid,$r); ?>
</div>
<!-----/ 拓展信息---->


<!-----账户信息---->
<div class="tab-content"  style="display: none;">
	<dl>
    <dt>账户金额</dt>
    <dd>
     <?php echo $row['amount']; ?><span class="Validform_checktip"><a href="account_log.php?keyword=<?php echo $row['username']; ?>">[查看明细]</a></span>
    </dd>
  </dl>
   <dl>
    <dt>积分</dt>
    <dd>
    <?php echo $row['integral']; ?><span class="Validform_checktip"><a href="account_log.php?keyword=<?php echo $row['username']; ?>">[查看明细]</a></span>
    </dd>
  </dl> 
   <dl>
    <dt>经验值</dt>
    <dd>
     <input type="text" name="expval" id="expval" class="input small" value="<?php echo $row['expval']; ?>" datatype="*" nullmsg="经验值不能为空" errormsg="经验值点数应该为1-8位的数字" sucmsg=" " />
    <span class="Validform_checktip">经验值影响会员组</span></dd>
  </dl>
     <dl>
    <dt>绑定QQ：</dt>
    <dd>
  <?php if($row['qqid'] != ''){echo $row['qqid'].'&nbsp;&nbsp;<span class="cutimg"><a href="member_save.php?action=removeoqq&id='.$row['id'].'">解除绑定</a></span>';}else{echo '暂无绑定';} ?>
    </dd>
  </dl> 
  <dl>
    <dt>绑定微博：</dt>
    <dd>
   <?php if($row['weiboid'] != ''){echo $row['weiboid'].'&nbsp;&nbsp;<span class="cutimg"><a href="member_save.php?action=removeoweibo&id='.$row['id'].'">解除绑定</a></span>';}else{echo '暂无绑定';} ?>
    </dd>
  </dl> 
 <dl>
    <dt>登录信息：</dt>
    <dd>
   TIME <?php echo GetDateTime($row['logintime']); ?>&nbsp;-&nbsp;IP <?php echo $row['loginip']; ?>
    </dd>
  </dl> <dl>
    <dt>注册信息：</dt>
    <dd>
  TIME <?php echo GetDateTime($row['regtime']); ?>&nbsp;-&nbsp;IP <?php echo $row['regip']; ?>
    </dd>
  </dl>
</div>
<!--/内容-->

<!--工具栏-->
<div class="page-footer">
  <div class="btn-wrap">
  <input type="submit" name="btnSubmit" value="提交保存" id="btnSubmit" class="btn" />
    <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);" />
	<input type="hidden" name="action" id="action" value="update" />
	<input type="hidden" name="id" id="id" value="<?php echo $row['id']; ?>" />
	<input type="hidden" name="oldmodelid" id="modelid" value="<?php echo $row['modelid']; ?>" />
	<input type="hidden" name="username" id="username" value="<?php echo $row['username']; ?>" />
  </div>
</div>
<!--/工具栏-->

</form>
</body>
</html>